6.3. Cadence Tools

To run simulation and technology implementation, we are using some Industry Tools from Cadence Systems. Those tools are always started from the command line by running a special command.

6.3.1. Linux

The Cadence Tools run under Linux. If you are not comfortable with Linux, you can start by reading the Linux section.

6.3.2. Loading the tools in the terminal

To have access to the tools commands, you have to source a setup script in your terminal:

source /var/autofs/cadence/umc_65.sh

Warning

You have to run this source command every time you open a new terminal

6.3.3. Simulation: Irun

If you have read about Icarus Simulator, you will see that the Cadence Simulator runs in a similar way.

The Cadence Tools Suite is called INCISIVE and features:

  • A Code compiler (NC-Verilog)
  • A Simulator (NC-SIM)
  • A Graphical Interface to visualize the waveform results (SimVision).

All these tools can be called using one command called irun

6.3.3.1. Irun: Compiling files - Error debugging

To compile a file using irun, simply pass the file to the command:

$ irun counter.v

If there is an error in the file, you will see and output like this one:

irun(64): 15.20-s019: (c) Copyright 1995-2017 Cadence Design Systems, Inc.
file: counter.v
   input wire reset
       |
ncvlog: *E,EXPCOM (counter.v,4|5): expecting a comma [3.2.1][6.1(IEEE)].
   module worklib.example_error:v
      errors: 1, warnings: 0

This error means a problem was detected on Line 4, see ncvlog: *E,EXPCOM (counter.v,4|5):”.

To find out why, here is the involved code:

1
2
3
4
5
6
7
module example_error (

   input wire clock
   input wire reset
);

endmodule

There is a comma missing after “clock” on line 3, that is why the error is located afterwards, on line 4.

6.3.3.2. Irun GUI: Start Simvision

If you want to look at the simulation output, you can use the -gui -access +rw switch with irun:

$ irun -gui -access +rw tb_example.v

A window will come up on which you can see the design hierarchy on the left, and on the right the Signals of the selected element:

../../_images/simvision-db.png

This example only has one testbench module with a clock in it, so it is all pretty empty. Here is the code, note the following points:

  • The clock has an initial value of 0 (see initial block)
  • The simulation is stopped after some time (see #500 $finish())
  • If you don’t stop the simulation, it will run until you manually stop it
module tb_example;

   reg clock;

   initial begin

      // Initial Value for clock
      clock = 0;

      // Stop after a while
      #200 $finish();

   end

   always begin
      #5 clock <= ~ clock;
   end

endmodule

To look at a Simulation output, you can send the module to a new Waveform window by doing:

  • Left Click on the Module name
  • Send To Waveform Window

You should see a Waveform Window with on the left, the signals of the selected module.

In our case, just the clock:

../../_images/simvision-wf.png

6.3.3.3. Irun GUI: Simulate and Resimulate

Once you have openend a Waveform Window, you can start the simulation by pressing the “Start” button in the tool bar:

../../_images/simvision-startstop.png

If you have no $finish in your test bench, you will have to stop the simulation manually by clicking the stop button.

When Simulation is running or after a stop, you will see the signal values in the window:

../../_images/simvision-values.png

You can resimulate using the “reset” button, then pressing “Start” again.

Warning

Resimulating does not reload the files. If you changed the design you have to reload the simulator

6.3.3.4. Irun GUI: Reload on File change

If you have changed your design, you need to recompile the files.

To do so, you don’t have to stop Simvision and re-open it, you can use from the Waveform the Menu “Simulation”:

../../_images/simvision-reinvoke.png

6.3.3.5. Irun GUI: Shortcuts

  • CTRL + Mousewheel to zoom in and out
  • Left Click and mouse drag from left to right: Zoom in a specific area
  • Open the Design Browser to add signals to the waveform:
../../_images/simvision-wf-db.png

6.3.3.6. Irun: Command file

Very quickly, the list of files and arguments to be passed to the simulator can grow, so it is convienient to save them to a file.

You can create file called a “Command File”, which contains a list of files and arguments to pass to the simulator

6.3.4. Synthesis: Genus

The cadence synthesis tool is called “GENUS”. When the tools are loaded, you should have access to a command called genus.

The tools’s interface is a TCL script interpreter. It means that the user writes a TCL script, from which functions can be called to load the design files, the libraries, start the synthesis and save reports and results.

To start with TCL, you can have a look at the page about tcl.

6.3.4.1. Genus Script from Interpreter

If you call the genus command, you will get a command line TCL interpreter, from which you can issue single commands to the software.

~ $ genus

This command will start a new command line, which is a TCL interpreter

This following info tclversion command will display the TCL version used as interpreter

genus@root:> info tclversion

8.5

genus@root:>

The command puts will just display a text on the command line:

genus@root:> puts “Hello world”

Hello world

genus@root:>

In the real world, the set of commands for synthesis is written inside a file, which you can source.

For example, if you wrote a file called “synthesize.tcl”, place in the same folder you started genus, you can load it from the interpreter using the source command:

genus@root:> source synthesize.tcl

6.3.4.2. Genus Script from the terminal

Genus can also load a script when starting, it makes the tool easier to restart: use the :arg:`-files FILE.TCL` argument:

dds17/assignmentX/synthesis/ $ genus -files synthesize.tcl